var selects;
var mode;
var EventList = Array(Array("#b[签到福利] 每日签到#k#l", 7), Array("#b[签到福利] 连续签到#k#l", 502), Array("#b[HOTTIME] 隐藏的箱子。#k#l", 103), Array("#b[HOTTIME] 数字猜猜猜！#k#l", 104), Array("#b[日常任务] 月枫的需求#k#l", 110), Array("#b[日常任务] 金利奇的口袋#k#l", 120), Array("#b[每日任务] 神秘微章 #k#l", 129), Array("#b[每日任务] 阿尔卡那-解救石精灵 #k#l", 130));

function start() {
    status = -1;
    action(1, 0, 0)
}

function action(e, c, b) {
    if (status >= 0 && e == 0) {
        cm.openNpc(9900003);
        return
    }
    if (e == 1) {
        status++
    } else {
        status--
    }
    if (status == 0) {
        var d = "目前" + cm.getServerName() + "已开始的活动有下列\r\n请按照您的喜好选择活动：\r\n#b";
        for (var a = 0; a < EventList.length; a++) {
            d += "#L" + a + "# " + EventList[a][0] + "\r\n"
        }
        cm.askMenu(d)
    } else {
        if (status == 1) {
            selects = b;
            e = EventList[selects][1];
            if (EventList[selects][1] >= 10000) {
                cm.openNpc(e)
            } else {
                switch (e) {
                    case 130:
                        cm.dispose();
                        cm.openNpc(3003381);
                        break;
                    default:
                        cm.dispose();
                        cm.openNpc(9900003, e)
                }
            }
        }
    }
}
var status = -1;